package com.fcml.pattern.decorator;

/**
 * @author fcml
 * @date 2018/11/7
 *
 * 具体的Soy装饰者
 * 装饰者保存了一个被装饰者的引用。
 */
public class Soy extends CondimentDecorator {
	private Beverage beverage;

	public Soy(Beverage beverage) {
		this.beverage = beverage;
	}

	@Override
	public String getDescription() {
		return beverage.getDescription() + ", Soy";
	}

	@Override
	public double cost() {
		return .15 + beverage.cost();
	}
}